<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>费用结算</title>
    <link href="<%=basePath%>css/style.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
    <script type="text/javascript">

        function cz(id){
            if (confirm("您确定要对此用户的余额进行操作吗？")) {
                window.location.href = "<%=basePath%>fyczController?id="+id;
            }
        }
        function settle(id){
            window.location.href="<%=basePath%>fyListController?id="+id;
        }

        function gotoPage(pn){
            if(null != pn && pn!=''){
                document.form1.action="<%=basePath%>fyListController?pn="+pn;
            }
            document.form1.submit();
        }
        $(function() {
            $('tbody tr:odd').addClass("trLight");

            $(".select-all").click(function () {
                if ($(this).attr("checked")) {
                    $(".checkBox input[type=checkbox]").each(function () {
                        $(this).attr("checked", true);
                    });
                } else {
                    $(".checkBox input[type=checkbox]").each(function () {
                        $(this).attr("checked", false);
                    });
                }
            });

        });

    </script>
    <style type="text/css">
        body {
            background:#FFF
        }
    </style>
</head>

<body>
<div id="contentWrap">
    <!--表格控件 -->
    <form action="<%=basePath%>fyListController" method="post" name="form1">
    <div id="widget table-widget">
        <div class="pageTitle">费用结算</div>
        <div class="querybody">
            <ul class="seachform">
                <li><label>会员ID</label><input name="memberid" type="text" class="scinput" /></li>
                <li><label>会员名称</label><input name="name" type="text" class="scinput" /></li>
                <li><label>&nbsp;</label><input name="" type="submit" class="scbtn" value="查询"/></li>
            </ul>
        </div>
        <div class="pageColumn">
            <div class="pageButton"><span>待结算列表</span></div>
            <table>
                <thead>
                <th width="">会员ID</th>
                <th width="">会员名称</th>
                <th width="">挂号号</th>
                <th width="">卡余额（元）</th>
                <th width="">结算金额</th>
                <th width="">待交费用（元）</th>
                <th width="">操作</th>
                </thead>
               <tbody>
                    <c:forEach items="${fyList}" var="fy" >
                        <tr>
                        <td>${fy.memberid}</td>
                        <td>${fy.name}</td>
                        <td>${fy.roid}</td>
                        <td>${fy.balance}</td>
                        <td>${fy.settleamount}</td>
                        <td>${fy.settleamount-fy.balance}</td>
                        <td>
                            <a onclick="cz('${fy.memberid}')"><img src="<%=basePath%>images/icon/edit2.png" width="16" height="16" /></a>
                        </td>
                        </tr>
                    </c:forEach>
               </tbody>

            </table>
        </div>
    </div><!-- #widget -->
    <div id="pagination" style="align:right;margin-top:-10px;">
        <div id='project_pagination' class="pagination pagination-centered">
            <div class="pagination">
                <ul>
                    <li><a href="javascript:void(0);" onclick="gotoPage(1)">首页</a></li>
                    <li><a href="javascript:void(0);" onclick="gotoPage(${pageInfo.pageNum-1})">上一页</a></li>
                    <li><a href="javascript:void(0);" onclick="gotoPage(${pageInfo.pageNum+1})">下一页</a></li>
                    <li><a href="javascript:void(0);" onclick="gotoPage(${pageInfo.pages})">尾页</a></li>
                </ul>
                <ul>
                    <li><span>共&nbsp;&nbsp;${pageInfo.total} 条记录&nbsp;&nbsp;</span></li>
                    <li><span>当前显示第&nbsp;${pageInfo.pageNum }&nbsp;页</span></li>
                </ul>
    </div>
        </div>
    </div>
    </form>
</div>
</body>
</html>
